<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>weui-upload</title>
	<link rel="stylesheet" href="weui/weui.css">
	<link rel="stylesheet" href="../src/css/weui.upload.min.css">
	<style>
		.page__hd {
		    padding: 40px;
		}
		.page__title {
		    text-align: left;
		    font-size: 20px;
		    font-weight: 400;
		}
		.page__desc {
		    margin-top: 4px;
		    color: var(--weui-FG-1);
		    text-align: left;
		    font-size: 14px;
		}
	</style>
</head>
<body>
	<div class="page__hd">
        <h1 class="page__title">weui-upload</h1>
        <p class="page__desc">weui上传扩展组件</p>
    </div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell  weui-cell_uploader">
            <div class="weui-cell__bd">
                <div class="weui-uploader" id="uploadDiv">
                </div>
            </div>
        </div>
        <div class="weui-cell  weui-cell_uploader">
            <div class="weui-cell__bd">
                <div class="weui-uploader" id="upload2Div">
                </div>
            </div>
        </div>
    </div>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script src="../src/js/weui.upload.min.js"></script>
	<script>
		$(function () {
			$('#uploadDiv').weuiUpload({
				maxNum: 5, 
				imageUrl: [
					'http://iph.href.lu/96x96?text=weui-upload&fg=666666&bg=cccccc',
					'http://iph.href.lu/96x96?text=weui-upload&fg=666666&bg=cccccc'
				]
			});
			
			$('#upload2Div').weuiUpload({
				title:'第二个图片上传', 
				inputName:'imgFile', 
				maxNum: 3, 
				imageUrl: [
					'http://iph.href.lu/96x96?text=weui-upload&fg=666666&bg=cccccc',
					'http://iph.href.lu/96x96?text=weui-upload&fg=666666&bg=cccccc',
					'http://iph.href.lu/96x96?text=weui-upload&fg=666666&bg=cccccc'
				], 
				error: function(res) {
					console.log(res);alert(res.msg);
				}
			});
		})
	</script>
</body>
</html>